MutableVec3

class MutableVec3(var x: Double, var y: Double, var z: Double) : Vector3<MutableVec3> (source)

A mutable 3-dimensional vector with double-precision components.

Constructors

Link copied to clipboard
constructor(x: Double, y: Double, z: Double)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var x: Double

The x-component of the vector.

Link copied to clipboard
open override var y: Double

The y-component of the vector.

Link copied to clipboard
open override var z: Double

The z-component of the vector.

Functions

Link copied to clipboard
open override fun angle(other: MutableVec3, angleUnit: AngleUnit): Double

Calculate the angle between this vector and another vector.

Link copied to clipboard
open fun computeScaleFactor(other: Vector3<*>): Double

Calculates the scale factor to project this vector onto another vector.

Link copied to clipboard
open infix fun cross(other: Vector3<*>): MutableVec3

Calculates the cross product of this vector with another vector.

Link copied to clipboard
open override fun dimensions(): Int

Returns the number of dimensions of the spatial object.

Link copied to clipboard
open infix override fun distance(other: MutableVec3): Double

Compute the distance to another point.

Link copied to clipboard
open infix override fun dot(other: MutableVec3): Double

Calculate the dot product of this vector with another vector.

Link copied to clipboard
open fun eq(other: Vector3<*>, equivalence: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE): Boolean

Checks if two vectors are equal within a specified tolerance.

Link copied to clipboard
open override fun isFinite(): Boolean

Returns true if all values in the spatial are finite.

Link copied to clipboard
open override fun isInfinite(): Boolean

Returns true if any value in the spatial is infinite.

Link copied to clipboard
open override fun isNaN(): Boolean

Returns true if any value in the spatial is NaN (Not a Number).

Link copied to clipboard
open fun lerp(other: Vector3<*>, t: Double): MutableVec3

Performs linear interpolation between this vector and another vector.

Link copied to clipboard
open operator override fun minus(other: MutableVec3): MutableVec3

Subtracts another vector from this vector.

Link copied to clipboard
open override fun norm(): Double

Calculates the norm (magnitude) of the vector.

Link copied to clipboard
open override fun normalize(): MutableVec3

Normalizes the vector.

Link copied to clipboard
open operator override fun plus(other: MutableVec3): MutableVec3

Adds another vector to this vector.

Link copied to clipboard
open fun project(base: Vector3<*>): MutableVec3

Calculate the projection of this vector onto another vector.

Link copied to clipboard
open fun reject(base: Vector3<*>): MutableVec3

Calculates the rejection of this vector from another vector.

Link copied to clipboard
open operator override fun times(scalar: Double): MutableVec3

Scale this vector by a scalar value.

Link copied to clipboard

Creates a mutable copy of this vector.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun toVec3(): Vec3

Converts this mutable vector to an immutable Vec3.

Link copied to clipboard
open operator override fun unaryMinus(): MutableVec3

Negates the vector, flipping its direction.

Link copied to clipboard
open override fun withComponents(x: Double, y: Double, z: Double): MutableVec3

Creates a vector with the specified components.

Link copied to clipboard
open override fun zero(): MutableVec3

Get Zero vector.